import React from 'react';
export default class CmtItem extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
        }
    }
    render() {
        return <li className="list-group-item">
            <p>{this.props.content}</p>
            <div className="clearfix">
                <p className="pull-left"><b>评论人:</b>{this.props.author}</p>
                <p className="pull-right"><small>评论时间:{this.props.posttime}</small></p>
            </div>
            <div className="clearfix">
                <button onClick={()=>this.delComment(this.props.id)} className="btn btn-xs btn-danger pull-right">删除</button>
            </div>
        </li>
    }
    // 删除评论
    delComment(id){
        console.log(id,'id');
        this.props.delComment(id);
    }
}